<?php

namespace app\model\zs;

use think\Model;

class ZsBallQuizze extends Model
{
    // 设置当前模型对应的完整数据表名称
    protected $table = 'ball_quizzes';

    // 设置当前模型的数据库连接
    protected $connection = 'zs';

    // 自动写入时间的类型
    protected $autoWriteTimestamp = 'datetime';

    // 定义时间戳字段名
    protected $createTime = 'create_at';
    protected $updateTime = 'update_at';

    const IS_RIGHT_YES = 1;
    const IS_RIGHT_NO = 2;

    public function memberUser()
    {
        return $this->belongsTo(ZsMemberMeal::class, 'vipcode', 'vipcode');
    }

    public function raceModel()
    {
        return $this->belongsTo(ZsBallRace::class, 'race_id', 'id');
    }
}
